<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    function Model(){
  this.m1 = function(){
    return "hello"
  }
  this.m2 = function(){
    return "world"
  }
  this.m3 = function(){
    return "123"
  }
  this.m4 = function(){
    return "hahaha"
  }
}

function View(){
  this.v1 = function(d){
    console.log(d);
  }
  this.v2 = function(d){
    alert(d)
  }
  this.v3 = function(d){
    document.write(d)
  }
}

function Control(){
  const m = new Model()
  const v = new View()
  this.c1 = function(){
    const d = m.m1();
    v.v2(d);
  }
  this.c2 = function(){
    const d = m.m4();
    v.v1(d);
  }
  this.c3 = function(){
    const d = m.m2();
    v.v3(d);
  }
  this.c4 = function(){
    const d = m.m2();
    v.v1(d);
  }
}

const c = new Control();
c.c1();
c.c2();
</script>
</html>